package com.lrkj.property.service.impl;

import java.util.List;

import com.lrkj.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.property.mapper.OwnerDoorMapper;
import com.lrkj.property.domain.OwnerDoor;
import com.lrkj.property.service.IOwnerDoorService;

/**
 * 业主门禁Service业务层处理
 *
 * @author yajun_ren
 * @date 2021-08-18
 */
@Service
public class OwnerDoorServiceImpl implements IOwnerDoorService
{
    @Autowired
    private OwnerDoorMapper ownerDoorMapper;

    /**
     * 查询业主门禁
     *
     * @param id 业主门禁ID
     * @return 业主门禁
     */
    @Override
    public OwnerDoor selectOwnerDoorById(String id)
    {
        return ownerDoorMapper.selectOwnerDoorById(id);
    }

    /**
     * 查询业主门禁列表
     *
     * @param ownerDoor 业主门禁
     * @return 业主门禁
     */
    @Override
    public List<OwnerDoor> selectOwnerDoorList(OwnerDoor ownerDoor)
    {
        return ownerDoorMapper.selectOwnerDoorList(ownerDoor);
    }

    /**
     * 新增业主门禁
     *
     * @param ownerDoor 业主门禁
     * @return 结果
     */
    @Override
    public int insertOwnerDoor(OwnerDoor ownerDoor)
    {
        ownerDoor.setId(IdUtils.simpleUUID());
        return ownerDoorMapper.insertOwnerDoor(ownerDoor);
    }

    /**
     * 修改业主门禁
     *
     * @param ownerDoor 业主门禁
     * @return 结果
     */
    @Override
    public int updateOwnerDoor(OwnerDoor ownerDoor)
    {
        return ownerDoorMapper.updateOwnerDoor(ownerDoor);
    }

    /**
     * 批量删除业主门禁
     *
     * @param ids 需要删除的业主门禁ID
     * @return 结果
     */
    @Override
    public int deleteOwnerDoorByIds(String[] ids)
    {
        return ownerDoorMapper.deleteOwnerDoorByIds(ids);
    }

    /**
     * 删除业主门禁信息
     *
     * @param id 业主门禁ID
     * @return 结果
     */
    @Override
    public int deleteOwnerDoorById(String id)
    {
        return ownerDoorMapper.deleteOwnerDoorById(id);
    }
}
